Page MenuHomeFreeBSD

Fix gateway setup for the interface routes.
ClosedPublic

Authored by melifaro on May 20 2019, 11:32 PM.

Details

Summary

Currently rinit1() and its IPv6 counterpart nd6_prefix_onlink_rtrequest() uses dummy null_sdl gateway address during route insertion and fill it afterwards. One of the original reasons might reside in the concern that sizeof(struct sockadd_dl) is rather big to be on-stack (54 bytes on amd64).
Inserting fake gateway and silently fixing it afterwards brings complications to the routing stack.

This change fixes both rinit1() and nd6_prefix_onlink_rtrequest() by filling in proper gateway prior to the inserion. It does not change any of the userland notifications as in both cases, they happen after the insertion and fixup process (rt_newaddrmsg_fib() and nd6_rtmsg())

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

melifaro created this revision.May 20 2019, 11:32 PM
melifaro edited the summary of this revision. (Show Details)May 20 2019, 11:43 PM
melifaro added reviewers: network, ae.
ae accepted this revision as: ae.May 21 2019, 8:29 AM

LGTM.

This revision is now accepted and ready to land.May 21 2019, 8:29 AM
This revision was automatically updated to reflect the committed changes.