commit fd4494f6c62ce7eaa7cea7fa32df287ee211d49b from: smytht via: GitHub date: Fri Aug 16 17:11:41 2024 UTC Merge pull request #153 from stspdotname/pairfix fix conf_patch to avoid overwriting the current interface being shown I have reviewed the Code what stsp describes makes sense and the diff works and appears to solves the issue raised by ryan-sg OK Tom commit - 0a94b494fb23efcec9472c5d614ffe4188c1825d commit + fd4494f6c62ce7eaa7cea7fa32df287ee211d49b blob - b2f75596c7a2341b035284c80351db2dd73c1944 blob + 7da1c63710f2852205df3e10d461e0d6b93ab569 --- conf.c +++ conf.c @@ -874,13 +874,14 @@ void conf_vnetflowid(FILE *output, int ifs, char *ifna void conf_patch(FILE *output, int ifs, char *ifname) { struct ifreq ifr; + char ifix_buf[IFNAMSIZ]; memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); if (ioctl(ifs, SIOCGIFPAIR, &ifr) == 0 && ifr.ifr_index != 0 && - if_indextoname(ifr.ifr_index, ifname) != NULL) - fprintf(output, " patch %s\n", ifname); + if_indextoname(ifr.ifr_index, ifix_buf) != NULL) + fprintf(output, " patch %s\n", ifix_buf); } void conf_parent(FILE *output, int ifs, char *ifname)