aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_pppoe.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2002-05-14 12:32:41 +0000
committerBrian Somers <brian@FreeBSD.org>2002-05-14 12:32:41 +0000
commit87c4cce00efd2b78297b0dc2362ec91426b21229 (patch)
tree55618b3d3787a1c2a48f6cc8fcd524b26fd2e06e /sys/netgraph/ng_pppoe.c
parent8fed82b9af4e202844a4322dc41dcaec377da5df (diff)
downloadsrc-87c4cce00efd2b78297b0dc2362ec91426b21229.tar.gz
src-87c4cce00efd2b78297b0dc2362ec91426b21229.zip
Add a NGM_PPPOE_SESSIONID message to the ng_pppoe node.
This message is sent to the control socket when the SessionID is established. Approved by: archie (after a very cursory glance)
Notes
Notes: svn path=/head/; revision=96578
Diffstat (limited to 'sys/netgraph/ng_pppoe.c')
-rw-r--r--sys/netgraph/ng_pppoe.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c
index 65aa93fb57c4..882d45fce226 100644
--- a/sys/netgraph/ng_pppoe.c
+++ b/sys/netgraph/ng_pppoe.c
@@ -908,6 +908,23 @@ send_acname(sessp sp, struct pppoe_tag *tag)
return (error);
}
+static int
+send_sessionid(sessp sp)
+{
+ int error;
+ struct ng_mesg *msg;
+
+ NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_SESSIONID,
+ sizeof(u_int16_t), M_NOWAIT);
+ if (msg == NULL)
+ return (ENOMEM);
+
+ *(u_int16_t *)msg->data = sp->Session_ID;
+ NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, NULL);
+
+ return (error);
+}
+
/*
* Receive data, and do something with it.
* The caller will never free m or meta, so
@@ -1139,6 +1156,7 @@ AAA
neg->pkt->pkt_header.ph.sid =
htons(sp->Session_ID
= get_new_sid(node));
+ send_sessionid(sp);
neg->timeout = 0;
/*
* start working out the tags to respond with.
@@ -1206,6 +1224,7 @@ AAA
neg->timeout_handle);
neg->pkt->pkt_header.ph.sid = wh->ph.sid;
sp->Session_ID = ntohs(wh->ph.sid);
+ send_sessionid(sp);
neg->timeout = 0;
sp->state = PPPOE_CONNECTED;
/*