| 751adc91 | 14-Nov-2023 |
Aaron LI <aly@aaronly.me> |
ipfw3: Fix offset mistake in creating the MAC-type table
The rn_inithead() requires the offset be the bit count of the address portion from the key beginning, so it should be offsetof(struct sockadd
ipfw3: Fix offset mistake in creating the MAC-type table
The rn_inithead() requires the offset be the bit count of the address portion from the key beginning, so it should be offsetof(struct sockaddr, sa_data) * NBBY = 2 * 8 = 16 (instead of 48) for the MAC-type table.
Also change to use offsetof() to replace the hardcode 32 in creating the IP-type table. In addition, improve the assignments of sin_len/sa_len members of the keys.
While there, fix the indentation style.
show more ...
|