UpgradeNotes: patch-all2.patch
File patch-all2.patch, 5.8 KB (added by , 12 years ago) |
---|
-
lwipv6/lwip-v6/src/core/netif.c
518 518 if (name == NULL) { 519 519 return NULL; 520 520 } 521 521 522 /* atoi allows longer names -- tvf */ 522 523 if (name[2] >= '0' && name [2] <= '9') 523 num = name[2] - '0';524 num = atoi(name+2); 524 525 else 525 526 num = 0; 526 527 … … 683 684 else { 684 685 ifr->ifr_name[0]=nip->name[0]; 685 686 ifr->ifr_name[1]=nip->name[1]; 686 ifr->ifr_name[2]=(nip->num%10)+'0'; 687 ifr->ifr_name[3]= 0; 688 ifr->ifr_name[4]= 0; 687 /* XXX: only 100 interfaces */ 688 if (nip->num < 10 ) { 689 ifr->ifr_name[2]=(nip->num%10)+'0'; 690 ifr->ifr_name[3]= 0; 691 ifr->ifr_name[4]= 0; 692 } 693 else { 694 ifr->ifr_name[2]=(nip->num/10)+'0'; 695 ifr->ifr_name[3]=(nip->num%10)+'0'; 696 ifr->ifr_name[4]= 0; 697 } 689 698 ifr->ifr_name[5]= 0; 690 699 retval=ERR_OK; 691 700 } 692 701 } else { 693 702 #define ifrname ifr->ifr_name 694 703 ifrname[4]=ifrname[5]=0; 695 if (ifrname[3] != 0 || (nip = netif_find(stack, ifrname)) == NULL) { 704 if ((nip = netif_find(stack, ifrname)) == NULL) { 705 fprintf(stderr, "EINVAL %s\n", ifrname); 696 706 retval=EINVAL; 697 707 } 698 708 else { … … 858 868 859 869 static void netif_out_link_ifname (int index,struct netif *nip,void * buf,int *offset) { 860 870 struct rtattr x; 861 char name[4]; 862 x.rta_len=sizeof(struct rtattr)+3; 871 char name[5]; 872 int fill=0; 873 int nl = 0; 874 875 /* Add the extra letters are for the device name, which has more 876 * letters when we have to encode longer interfaces. 877 * XXX: only 100 interfaces allowed */ 878 if (nip->num < 10) x.rta_len=sizeof(struct rtattr)+4; 879 else x.rta_len=sizeof(struct rtattr)+5; 863 880 x.rta_type=index; 864 881 netlink_addanswer(buf,offset,&x,sizeof (struct rtattr)); 865 882 name[0]=nip->name[0]; 866 883 name[1]=nip->name[1]; 867 name[2]=(nip->num)%10+'0'; 868 name[3]=0; 869 netlink_addanswer(buf,offset,name,sizeof(name)); 884 if (nip->num < 10) { 885 name[2]=(nip->num)%10+'0'; 886 name[3]=0; 887 nl = 4; 888 } 889 else { 890 /* XXX: more than 100 interfaces??? --tvf */ 891 name[2]=(nip->num)/10+'0'; 892 name[3]=(nip->num)%10+'0'; 893 name[4] = 0; 894 nl = 5; 895 } 896 netlink_addanswer(buf,offset,name,nl); 897 if (nl % RTA_ALIGNTO > 0) 898 netlink_addanswer(buf,offset,&fill,RTA_ALIGNTO - (nl%RTA_ALIGNTO)); 870 899 } 871 900 872 901 static void netif_out_link_mtu (int index,struct netif *nip,void * buf,int *offset) { -
xmview-os/xmview/capture_nested.c
1192 1192 int (*fn) (void *arg); 1193 1193 void *arg; 1194 1194 void *parentpcb; 1195 struct npcb *npcb; 1195 1196 }; 1196 1197 1197 1198 /* create a new (reduced) pcb for a thread */ 1198 static struct npcb *new_npcb(struct pcb *old )1199 static struct npcb *new_npcb(struct pcb *old, struct npcb *npcb) 1199 1200 { 1201 /* 1200 1202 struct npcb *npcb; 1201 1203 npcb=calloc(1,sizeof(struct npcb)); 1204 npcb = tryit + alloced++ * sizeof(struct npcb); 1205 */ 1202 1206 npcb->flags=PCB_ALLOCATED; 1203 1207 /* inherit the treepoch path from the generating thread */ 1204 1208 npcb->tst=old->tst; … … 1227 1231 static int clonewrap(void *carg){ 1228 1232 int (*fn) (void *arg) = ((struct clonearg *)(carg))->fn; 1229 1233 void *arg=((struct clonearg *)(carg))->arg; 1234 struct npcb *npcb = ((struct clonearg *)(carg))->npcb; 1230 1235 /* create a new pcb for the new thread, and link the pcb with this new 1231 1236 * thread */ 1232 set_pcb(new_npcb(((struct clonearg *)(carg))->parentpcb ));1237 set_pcb(new_npcb(((struct clonearg *)(carg))->parentpcb, npcb)); 1233 1238 /* free the data structure used to keep the thread info */ 1234 1239 free(carg); 1235 1240 /* start the real thread */ … … 1248 1253 carg->fn=fn; 1249 1254 carg->arg=arg; 1250 1255 carg->parentpcb=get_pcb(); 1256 /* Calloc inside the new thread after the libc__clone call dumps core */ 1257 carg->npcb = calloc(1, sizeof(struct npcb)); 1251 1258 /* start a wrapper to the real main function of the thread */ 1252 1259 rv= libc__clone(clonewrap,child_stack,flags,carg,arg2,arg3,arg4); 1253 1260 return rv; -
xmview-os/xmview/um_exec.c
180 180 } 181 181 */ 182 182 183 #define NOUMBINWRAP 183 184 #define UMBINWRAP LIBEXECDIR "/umbinwrap" 184 185 /* wrap_in: execve handling */ 185 186 int wrap_in_execve(int sc_number,struct pcb *pc, -
xmview-os/umnetlwipv6/umnetlwipv6.c
154 154 } 155 155 } 156 156 157 static int parseifnum(char *arg, int *iv) { 158 int i= 0; /* Scratch */ 159 for (i = 0; arg[i] != '\0' && arg[i] != '='; i++) 160 ; 161 *iv = atoi(arg); 162 return i; 163 } 164 165 157 166 static void myputenv(struct ifname **head, int *intnum, char *paramval[], char *arg) 158 167 { 159 168 int i; 160 169 for (i=0;i<INTTYPES;i++) { 161 170 if (strncmp(arg,intname[i],2)==0 && arg[2] >= '0' && arg[2] <= '9') { 162 if (arg[3] == '=') { 163 ifaddname(head, i,arg[2]-'0',arg+4); 164 if (arg[2]-'0'+1 > intnum[i]) intnum[i]=arg[2]-'0'+1; 171 int inum = 0; 172 int off = parseifnum(arg+2, &inum); 173 174 if (arg[off+2] == '=') { 175 ifaddname(head, i,inum,arg+off+3); 176 if (inum+1> intnum[i]) intnum[i]=inum+1; 165 177 } 166 else if (arg[ 3] == 0) {167 if ( arg[2]-'0' > intnum[i]) intnum[i]=arg[2]-'0';178 else if (arg[off+2] == 0) { 179 if (inum +1> intnum[i]) intnum[i]=inum+1; 168 180 } 169 181 break; 170 182 } … … 244 256 245 257 int umnetlwipv6_init (char *source, char *mountpoint, unsigned long flags, char *args, struct umnet *nethandle) { 246 258 struct stack *s=lwip_stack_new(); 259 lwip_stack_flags_set(s, 260 lwip_stack_flags_get(s) | LWIP_STACK_FLAG_FORWARDING); 247 261 if (s) { 248 262 lwipargtoenv(s,args); 249 263 umnet_setprivatedata(nethandle,s);