diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-01-28 17:33:16 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-28 17:33:16 +0400 |
commit | b604b6d912f100403def472d4a9a165612e439b2 (patch) | |
tree | 3b5ad3dd0d548c3265de48377d502fb4f5d182b2 /accel-pppd/ctrl/ipoe/dhcpv4.c | |
parent | 0ca38d8e1246716c8b53bc3191c5cccf9f228251 (diff) | |
download | accel-ppp-b604b6d912f100403def472d4a9a165612e439b2.tar.gz accel-ppp-b604b6d912f100403def472d4a9a165612e439b2.zip |
ipoe: changed assignment of Server-ID and Router options
Diffstat (limited to 'accel-pppd/ctrl/ipoe/dhcpv4.c')
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index e5a8731e..5885ac48 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -661,7 +661,7 @@ int dhcpv4_packet_add_opt(struct dhcpv4_packet *pack, int type, const void *data return 0; } -int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_packet *req, uint32_t yiaddr, uint32_t siaddr, uint32_t mask, int lease_time, struct dhcpv4_packet *relay) +int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_packet *req, uint32_t yiaddr, uint32_t siaddr, uint32_t router, uint32_t mask, int lease_time, struct dhcpv4_packet *relay) { struct dhcpv4_packet *pack; int val, r; @@ -698,7 +698,7 @@ int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_pack if (dhcpv4_packet_add_opt(pack, 51, &val, 4)) goto out_err; - if (dhcpv4_packet_add_opt(pack, 3, &siaddr, 4)) + if (router && dhcpv4_packet_add_opt(pack, 3, &router, 4)) goto out_err; val = htonl(~((1 << (32 - mask)) - 1)); @@ -707,7 +707,7 @@ int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_pack if (relay) { list_for_each_entry(opt, &relay->options, entry) { - if (opt->type == 53 || opt->type == 54 || opt->type == 51 || opt->type == 3 || opt->type == 1) + if (opt->type == 53 || opt->type == 54 || opt->type == 51 || opt->type == 1 || (opt->type == 3 && router)) continue; if (opt->type == 6) dns_avail = 1; |