bpf: add ip proto matching to socket-bind prog
authorJulia Kartseva <hex@fb.com>
Sat, 12 Jun 2021 01:27:27 +0000 (18:27 -0700)
committerJulia Kartseva <hex@fb.com>
Tue, 29 Jun 2021 21:37:07 +0000 (14:37 -0700)
commit560d76243fab5b7809996ac353fbc79da9a3bd92
tree6ccf3935faee6a5ef82c7de9d9e60c6e7cd631d2
parent9fcfc0470df856c870dcfc6df78bfbc714da6bd2
bpf: add ip proto matching to socket-bind prog

Lookup ip protocol in a socket address to allow or deny binding a socket
to the address.
Matching rule is extended with 'protocol' field. If its value is 0
(IPPROTO_IP) ip protocol comparison is omitted and matching is passed to
the next token which is ip ports.

Documentation is updated.
src/core/bpf-socket-bind.c
src/core/bpf/socket_bind/socket-bind-api.bpf.h
src/core/bpf/socket_bind/socket-bind.bpf.c