1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-07 00:15:34 +02:00

conf, dhcp, ndp: Fix message about default MTU, make NDP consistent

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-09-07 11:19:57 +02:00
parent 8e9333616a
commit ec2b58ea4d
3 changed files with 16 additions and 4 deletions

3
dhcp.c
View file

@ -49,7 +49,6 @@ struct opt {
static struct opt opts[255] = {
[1] = { 0, 4, { 0 }, 0, { 0 }, }, /* Mask */
[3] = { 0, 4, { 0 }, 0, { 0 }, }, /* Router */
[26] = { 0, 2, { 0xff, 0xf0 }, 0, { 0 }, }, /* MTU */
[51] = { 0, 4, { 0xff, 0xff, 0xff, 0xff }, 0, { 0 }, }, /* Lease time */
[53] = { 0, 1, { 0 }, 0, { 0 }, }, /* Type */
#define DHCPDISCOVER 1
@ -319,7 +318,7 @@ int dhcp(struct ctx *c, struct ethhdr *eh, size_t len)
*(unsigned long *)&opts[121].s[10] = c->gw4;
}
if (c->mtu) {
if (c->mtu != -1) {
opts[26].slen = 2;
opts[26].s[0] = c->mtu / 256;
opts[26].s[1] = c->mtu % 256;