source:
npl/internetserver/iproute2/iproute2-2.6.29.1-flush.patch
@
a384a97
Last change on this file since a384a97 was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 6.1 KB |
-
iproute2-2.6.29-1
diff -Nru iproute2-2.6.29-1.orig/ip/ipaddress.c iproute2-2.6.29-1/ip/ipaddress.c
old new 37 37 38 38 #define MAX_ROUNDS 10 39 39 40 static struct rtnl_handle rth_flush = { .fd = -1 }; 41 40 42 static struct 41 43 { 42 44 int ifindex; … … 339 341 340 342 static int flush_update(void) 341 343 { 342 if (rtnl_send_check(&rth , filter.flushb, filter.flushp) < 0) {344 if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) { 343 345 perror("Failed to send flush request"); 344 346 return -1; 345 347 } … … 697 699 filter.flushp = 0; 698 700 filter.flushe = sizeof(flushb); 699 701 702 if (rtnl_open(&rth_flush, 0) < 0) 703 return 1; 704 700 705 while (round < MAX_ROUNDS) { 701 706 if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) { 702 707 perror("Cannot send dump request"); … … 715 720 printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); 716 721 } 717 722 fflush(stdout); 723 rtnl_close(&rth_flush); 718 724 return 0; 719 725 } 720 726 round++; 721 727 if (flush_update() < 0) 722 return 1;728 break; 723 729 724 730 if (show_stats) { 725 731 printf("\n*** Round %d, deleting %d addresses ***\n", round, filter.flushed); 726 732 fflush(stdout); 727 733 } 728 734 } 729 fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", MAX_ROUNDS); fflush(stderr); 735 fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr); 736 rtnl_close(&rth_flush); 730 737 return 1; 731 738 } 732 739 -
iproute2-2.6.29-1
diff -Nru iproute2-2.6.29-1.orig/ip/ipneigh.c iproute2-2.6.29-1/ip/ipneigh.c
old new 32 32 #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY) 33 33 #define MAX_ROUNDS 10 34 34 35 static struct rtnl_handle rth_flush = { .fd = -1 }; 36 35 37 static struct 36 38 { 37 39 int family; … … 87 89 88 90 static int flush_update(void) 89 91 { 90 if (rtnl_send_check(&rth , filter.flushb, filter.flushp) < 0) {92 if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) { 91 93 perror("Failed to send flush request"); 92 94 return -1; 93 95 } … … 391 393 filter.flushe = sizeof(flushb); 392 394 filter.state &= ~NUD_FAILED; 393 395 396 if (rtnl_open(&rth_flush, 0) < 0) 397 return 1; 398 394 399 while (round < MAX_ROUNDS) { 395 400 if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) { 396 401 perror("Cannot send dump request"); … … 409 414 printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); 410 415 } 411 416 fflush(stdout); 417 rtnl_close(&rth_flush); 412 418 return 0; 413 419 } 414 420 round++; 415 421 if (flush_update() < 0) 416 exit(1); 422 break; 423 417 424 if (show_stats) { 418 425 printf("\n*** Round %d, deleting %d entries ***\n", round, filter.flushed); 419 426 fflush(stdout); 420 427 } 421 428 } 422 printf("*** Flush not complete bailing out after %d rounds\n",423 MAX_ROUNDS);429 fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr); 430 rtnl_close(&rth_flush); 424 431 return 1; 425 432 } 426 433 -
iproute2-2.6.29-1
diff -Nru iproute2-2.6.29-1.orig/ip/iproute.c iproute2-2.6.29-1/ip/iproute.c
old new 37 37 #define RTAX_RTTVAR RTAX_HOPS 38 38 #endif 39 39 40 static struct rtnl_handle rth_flush = { .fd = -1 }; 40 41 41 42 static const char *mx_names[RTAX_MAX+1] = { 42 43 [RTAX_MTU] = "mtu", … … 112 113 113 114 static int flush_update(void) 114 115 { 115 if (rtnl_send_check(&rth , filter.flushb, filter.flushp) < 0) {116 if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) { 116 117 perror("Failed to send flush request"); 117 118 return -1; 118 119 } … … 1210 1211 filter.flushp = 0; 1211 1212 filter.flushe = sizeof(flushb); 1212 1213 1214 if (rtnl_open(&rth_flush, 0) < 0) 1215 return 1; 1216 1213 1217 for (;;) { 1214 1218 if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) { 1215 1219 perror("Cannot send dump request"); … … 1228 1232 printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":""); 1229 1233 } 1230 1234 fflush(stdout); 1235 rtnl_close(&rth_flush); 1231 1236 return 0; 1232 1237 } 1233 1238 round++; -
ip/xfrm_policy.c
diff -Nru iproute2-2.6.29-1.orig/ip/xfrm_policy.c iproute2-2.6.29-1/ip/xfrm_policy.c
old new 756 756 struct xfrm_buffer xb; 757 757 char buf[NLMSG_DELETEALL_BUF_SIZE]; 758 758 int i; 759 struct rtnl_handle rth2; 759 760 760 761 xb.buf = buf; 761 762 xb.size = sizeof(buf); 762 763 xb.rth = &rth; 763 764 765 if (rtnl_open(&rth2, 0) < 0) 766 exit(1); 767 764 768 for (i = 0; ; i++) { 765 769 xb.offset = 0; 766 770 xb.nlmsg_count = 0; … … 783 787 break; 784 788 } 785 789 786 if (rtnl_send_check(&rth , xb.buf, xb.offset) < 0) {790 if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) { 787 791 perror("Failed to send delete-all request"); 788 792 exit(1); 789 793 } … … 793 797 xb.offset = 0; 794 798 xb.nlmsg_count = 0; 795 799 } 800 801 rtnl_close(&rth2); 796 802 } else { 797 803 if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETPOLICY) < 0) { 798 804 perror("Cannot send dump request"); -
iproute2-2.6.29-1
diff -Nru iproute2-2.6.29-1.orig/ip/xfrm_state.c iproute2-2.6.29-1/ip/xfrm_state.c
old new 924 924 struct xfrm_buffer xb; 925 925 char buf[NLMSG_DELETEALL_BUF_SIZE]; 926 926 int i; 927 struct rtnl_handle rth2; 927 928 928 929 xb.buf = buf; 929 930 xb.size = sizeof(buf); 930 931 xb.rth = &rth; 931 932 933 if (rtnl_open(&rth2, 0) < 0) 934 exit(1); 935 932 936 for (i = 0; ; i++) { 933 937 xb.offset = 0; 934 938 xb.nlmsg_count = 0; … … 951 955 break; 952 956 } 953 957 954 if (rtnl_send_check(&rth , xb.buf, xb.offset) < 0) {958 if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) { 955 959 perror("Failed to send delete-all request\n"); 956 960 exit(1); 957 961 } … … 962 966 xb.nlmsg_count = 0; 963 967 } 964 968 969 rtnl_close(&rth2); 965 970 } else { 966 971 if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETSA) < 0) { 967 972 perror("Cannot send dump request");
Note: See TracBrowser
for help on using the repository browser.