Skip to content

Commit

Permalink
punt-kernel-node: fix closing stdin if IPv6 is disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Jalal Mostafa <[email protected]>
  • Loading branch information
jalalmostafa authored and KeithWiles committed May 17, 2024
1 parent 7b845e6 commit 9413087
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/cnet/punt/punt_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ punt_kernel_node_init(const struct cne_graph *graph __cne_unused, struct cne_nod
ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (ctx->sock < 0)
CNE_ERR_RET("Unable to open IPv4 RAW socket\n");

ctx->sock6 = -1;
if (CNET_ENABLE_IP6 && (ctx->sock6 = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW)) < 0)
CNE_ERR_RET("Unable to open IPv6 RAW socket\n");
return 0;
Expand Down

0 comments on commit 9413087

Please sign in to comment.