diff options
author | Linus Nordberg <linus@nordu.net> | 2010-09-29 10:53:01 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2010-09-29 10:53:01 +0200 |
commit | e2633633030e62994ca41ff62006e3e40517c73a (patch) | |
tree | 60d68506aac2dd1499f19f766c8fc5a26a96a231 /lib/packet.c | |
parent | 7ef1fda097c5c96e201d50db2892d1c2354eb6d4 (diff) |
WIP -- resolving, crafting packet.
Diffstat (limited to 'lib/packet.c')
-rw-r--r-- | lib/packet.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/packet.c b/lib/packet.c index 74ca391..eefb5eb 100644 --- a/lib/packet.c +++ b/lib/packet.c @@ -23,10 +23,11 @@ _packet_create (struct rs_connection *conn, struct rs_packet **pkt_out, rpkt->code = code; p = (struct rs_packet *) malloc (sizeof (struct rs_packet)); - if (!p) { - rad_free (&rpkt); - return rs_conn_err_push (conn, RSE_NOMEM, __func__); - } + if (!p) + { + rad_free (&rpkt); + return rs_conn_err_push (conn, RSE_NOMEM, __func__); + } memset (p, 0, sizeof (struct rs_packet)); p->rpkt = rpkt; @@ -50,7 +51,7 @@ rs_packet_create_acc_request (struct rs_connection *conn, return -1; rs_packet_add_attr (pkt, attr); - if (rs_attr_create (conn, &attr, "User-Password", user_name)) + if (rs_attr_create (conn, &attr, "User-Password", user_pw)) return -1; /* FIXME: need this too? rad_pwencode(user_pw, &pwlen, SECRET, reqauth) */ rs_packet_add_attr (pkt, attr); @@ -72,7 +73,7 @@ rs_packet_send (struct rs_connection *conn, const struct rs_packet *pkt, } rad_encode (pkt->rpkt, NULL, conn->active_peer->secret); #if defined (DEBUG) - fprintf (stderr, "%s: about to send this to %s", __func__, "fixme"); + fprintf (stderr, "%s: about to send this to %s:\n", __func__, "<fixme>"); rs_dump_packet (pkt); #endif |