diff options
author | Kozlov Dmitry <dima@server> | 2011-08-23 13:32:05 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-08-23 13:32:05 +0400 |
commit | e281cbf20eb2e8f36ef5037e138fdf3798f1897d (patch) | |
tree | 983fb590fff7c2098393a3bb2627e73300e6a490 /accel-pppd/ppp/ppp.c | |
parent | a1e212b0a8f1968806889e455c605ac3720060b7 (diff) | |
download | accel-ppp-xebd-e281cbf20eb2e8f36ef5037e138fdf3798f1897d.tar.gz accel-ppp-xebd-e281cbf20eb2e8f36ef5037e138fdf3798f1897d.zip |
ppp: Neighbor Discovery for IP version 6 (prefix only)
Diffstat (limited to 'accel-pppd/ppp/ppp.c')
-rw-r--r-- | accel-pppd/ppp/ppp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index b541ba5..7406bf7 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -88,6 +88,8 @@ static void generate_sessionid(struct ppp_t *ppp) int __export establish_ppp(struct ppp_t *ppp) { + struct ifreq ifr; + /* Open an instance of /dev/ppp and connect the channel to it */ if (ioctl(ppp->fd, PPPIOCGCHAN, &ppp->chan_idx) == -1) { log_ppp_error("ioctl(PPPIOCGCHAN): %s\n", strerror(errno)); @@ -136,8 +138,17 @@ int __export establish_ppp(struct ppp_t *ppp) generate_sessionid(ppp); sprintf(ppp->ifname, "ppp%i", ppp->unit_idx); + memset(&ifr, 0, sizeof(ifr)); + strcpy(ifr.ifr_name, ppp->ifname); + + if (ioctl(sock_fd, SIOCGIFINDEX, &ifr)) { + log_ppp_error("ppp: ioctl(SIOCGIFINDEX): %s\n", strerror(errno)); + goto exit_close_unit; + } + ppp->ifindex = ifr.ifr_ifindex; + log_ppp_info1("connect: %s <--> %s(%s)\n", ppp->ifname, ppp->ctrl->name, ppp->chan_name); - + init_layers(ppp); if (list_empty(&ppp->layers)) { |