From 277b9588fde66850171e013051d79737a01c3de9 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 15 Dec 2021 05:06:08 +0200 Subject: [PATCH] ifconfig: add rxtls and -rxtls commands Reviewed by: hselasky, jhb, kp Sponsored by: NVIDIA Networking MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D32551 --- sbin/ifconfig/ifconfig.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 9ee86b2a5169..2ed7d43ac50c 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1280,7 +1280,12 @@ setifcapnv(const char *vname, const char *arg, int s, const struct afswtch *afp) neg = *mopt == '-'; if (neg) mopt++; - nvlist_add_bool(nvcap, mopt, !neg); + if (strcmp(mopt, "rxtls") == 0) { + nvlist_add_bool(nvcap, "rxtls4", !neg); + nvlist_add_bool(nvcap, "rxtls6", !neg); + } else { + nvlist_add_bool(nvcap, mopt, !neg); + } } buf = nvlist_pack(nvcap, &nvbuflen); if (buf == NULL) { @@ -1739,6 +1744,10 @@ static struct cmd basic_cmds[] = { DEF_CMD("-lro", -IFCAP_LRO, setifcap), DEF_CMD("txtls", IFCAP_TXTLS, setifcap), DEF_CMD("-txtls", -IFCAP_TXTLS, setifcap), + DEF_CMD_SARG("rxtls", IFCAP2_RXTLS4_NAME "," IFCAP2_RXTLS6_NAME, + setifcapnv), + DEF_CMD_SARG("-rxtls", "-"IFCAP2_RXTLS4_NAME ",-" IFCAP2_RXTLS6_NAME, + setifcapnv), DEF_CMD("wol", IFCAP_WOL, setifcap), DEF_CMD("-wol", -IFCAP_WOL, setifcap), DEF_CMD("wol_ucast", IFCAP_WOL_UCAST, setifcap),