Skip to content

DHCPv6: Add support for sending Option 17 (VSIO)#374

Closed
spoljak-ent wants to merge 0 commit intoNetworkConfiguration:masterfrom
spoljak-ent:master
Closed

DHCPv6: Add support for sending Option 17 (VSIO)#374
spoljak-ent wants to merge 0 commit intoNetworkConfiguration:masterfrom
spoljak-ent:master

Conversation

@spoljak-ent
Copy link
Contributor

Hi,
I made a patch for the support of sending DHCPv6 Option 17.
The options can be added similarly to the current vendor option 43.

Just add in config file as many options as needed like this:
vsio ent_num opt_num,option

Please comment and review.
Thanks.

Copy link
Member

@rsmarples rsmarples left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we wrap this in #ifndef SMALL please so we don't bloat the code for installations where size matters?

src/dhcp6.c Outdated
vlen = 0;

for (i = 0, vsio6 = ifo->vsio6; i < ifo->vsio6_len;
i++, vsio6++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than increment two things, we can just increment vsio6.
For this to work we need to work out the address of the final pointer using vsio6_len.
*vsio6_endp = ifo->vsio6 + ifo->vsio6_len and then compare.
I would front load this in the variable declaration at the top to reduce the number of lines the for loop takes up.

src/dhcp6.c Outdated
if (vsio6->en != en)
continue;
vlen += 2 * sizeof(uint16_t) + vsio6->len;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be one indent to the left.

src/dhcp6.c Outdated
p += sizeof(pen);

for (i = 0, vsio6 = ifo->vsio6; i < ifo->vsio6_len;
i++, vsio6++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@spoljak-ent
Copy link
Contributor Author

spoljak-ent commented Oct 9, 2024

Can we wrap this in #ifndef SMALL please so we don't bloat the code for installations where size matters?

No problem... Just to be sure, the whole implementation or some specific lines?

@rsmarples
Copy link
Member

Can we wrap this in #ifndef SMALL please so we don't bloat the code for installations where size matters?

No problem... Just to be sure, the whole implementation or some specific lines?

Whole implementation please.

@spoljak-ent
Copy link
Contributor Author

Can we wrap this in #ifndef SMALL please so we don't bloat the code for installations where size matters?

No problem... Just to be sure, the whole implementation or some specific lines?

Whole implementation please.
Sure thing.
Had to pull recent changes and everything was overwritten... I've created a new pull request for this:
#382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants