-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update loading and chaining of the connection_limit #65
Conversation
This PR depends l3af-project/l3afd#279 |
48d4f58
to
0d6e440
Compare
static int is_ipv4_loopback(uint32_t *addr4); | ||
static int is_ipv6_loopback(struct in6_addr *addr6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the inconsistent types? i.e. why not struct in_addr in line 41?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of this method is to confirm whether the local address is a loopback address or not. It achieves this by extracting the current connection count from procfs. When it comes to IPv4, the local address is in uint32 format, whereas for IPv6 addresses, there are multiple uint32 values. Therefore, the data is organized into a struct and then passed to this verification method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't answer the question. Why the inconsistent types of uint32_t vs struct in6_addr? Why not simply uint8_t* in both cases? or struct in_addr and struct in6_addr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #69
0d6e440
to
a859eb6
Compare
47b3041
to
ede7129
Compare
|
||
int map_fd[MAP_COUNT]; | ||
int conn_count_map_fd = -1, tcp_conns_map_fd = -1, conn_info_map_fd = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we retain map_fd[] array and have enums for each index like, CONN_COUNT, TCP_CONNS & CONN_INFO so that its extensible ?
snprintf(map_dir, MAP_PATH_SIZE, "%s/%s", map_base_dir, ifname); | ||
struct stat st = {0}; | ||
if (stat(map_dir, &st) != 0) { | ||
mkdir (map_dir, 0700); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we handle the error case for mkdir()
|
||
memset(ports, '\0', 2048); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have MACRO for the array size ?
f4f4092
to
3208c69
Compare
Signed-off-by: Santhosh Fernandes <[email protected]>
3208c69
to
9fe0987
Compare
This PR is to make changes to the connection limit program to load from the l3afd. Specifically, the modification involves removing the loading and chaining functionality from the user program. The user program will no longer run as a daemon. Additionally, maps will be accessed from a directory path specific to the interface, which is located at
/sys/bpf/fs/<iface>
.