OS-6768 overlays should be capable of L3 routing#341
Conversation
|
I don't plan to integrate this until the other bits are also ready, but just to get a start on things.. |
danmcd
left a comment
There was a problem hiding this comment.
Pass 0 checkpoint mid-way through overlay_router.c
| }; | ||
|
|
||
| static inline void | ||
| net_addr(in_addr_t *dest, const in_addr_t *src, uint8_t prefixlen) |
There was a problem hiding this comment.
You think this would be something in libnsl or libsocket.
(This also reminds me we need to fold most/all of libnsl & libsocket into libc...)
| * We require at least one address, as well as the parameters in | ||
| * req_params. | ||
| * | ||
| * XXX: Error message could probably be made better. |
There was a problem hiding this comment.
Split the missing-addresses out from the req_params.
| #if !defined(_BOOT) && !defined(_KMDB) | ||
| #include "lint.h" | ||
| #endif /* !_BOOT && !_KMDB */ | ||
| #ifndef _KERNEL |
There was a problem hiding this comment.
Which? Adding bsearch() to genunix or the #ifndef bits?
| if (ret > 0) | ||
| return (-1); | ||
|
|
||
| /* |
| strlen(rnet->oin_routetbl) != 0) | ||
| return (EINVAL); | ||
|
|
||
| /* TODO */ |
There was a problem hiding this comment.
XXX KEBE ASKS what's the plan for this?
There was a problem hiding this comment.
The idea is to add a 'flush' command, similar to route flush. Just ran out of time.
danmcd
left a comment
There was a problem hiding this comment.
Pass 0 finished.
I don't see a lot that triggers my obvious-problem detectors. I'll provide pass 1 after responses and when both TRITON-2188 goes back and the Triton 20210131 release drops.
| const overlay_net_t *r = b; | ||
| const struct in6_addr *laddr = &l->ont_netv6; | ||
| const struct in6_addr *raddr = &r->ont_netv6; | ||
|
|
There was a problem hiding this comment.
Don't you need to ntohl() these 4-byte components as well, like you do in the IPv4 case?
There was a problem hiding this comment.
It's doing a per-byte (instead of per 32-bit integer) comparison, so it shouldn't be necessary. If we want to compare 32 or 64 bits at a time, then I believe it would.
| bcopy(&otc->otc_entry.otce_dest.otp_ip, | ||
| &ote->ote_key.otk_ip, sizeof (struct in6_addr)); | ||
| } else { | ||
| bcopy(otc->otc_entry.otce_mac, ote->ote_key.otk_mac, |
There was a problem hiding this comment.
I take it zeroing-out isn't going to matter here.
There was a problem hiding this comment.
The kmem cache constructor zeros out the entry, and we also zero out the fields when we free the entry (prior to returning it to the cache), so it should already be zeroed.
No description provided.