UpgradeNotes: patch
File patch, 5.6 KB (added by , 12 years ago) |
---|
-
lwipv6/lwip-v6/src/core/netif.c
683 683 else { 684 684 ifr->ifr_name[0]=nip->name[0]; 685 685 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; 686 /* XXX: only 100 interfaces */ 687 if (nip->num < 10 ) { 688 ifr->ifr_name[2]=(nip->num%10)+'0'; 689 ifr->ifr_name[3]= 0; 690 ifr->ifr_name[4]= 0; 691 } 692 else { 693 ifr->ifr_name[2]=(nip->num/10)+'0'; 694 ifr->ifr_name[3]=(nip->num%10)+'0'; 695 ifr->ifr_name[4]= 0; 696 } 689 697 ifr->ifr_name[5]= 0; 690 698 retval=ERR_OK; 691 699 } 692 700 } else { 693 701 #define ifrname ifr->ifr_name 694 702 ifrname[4]=ifrname[5]=0; 695 if (ifrname[3] != 0 || (nip = netif_find(stack, ifrname)) == NULL) { 703 if ((nip = netif_find(stack, ifrname)) == NULL) { 704 fprintf(stderr, "EINVAL %s\n", ifrname); 696 705 retval=EINVAL; 697 706 } 698 707 else { … … 858 867 859 868 static void netif_out_link_ifname (int index,struct netif *nip,void * buf,int *offset) { 860 869 struct rtattr x; 861 char name[4]; 862 x.rta_len=sizeof(struct rtattr)+3; 870 char name[5]; 871 int fill=0; 872 int nl = 0; 873 874 /* Add the extra letters are for the device name, which has more 875 * letters when we have to encode longer interfaces. 876 * XXX: only 100 interfaces allowed */ 877 if (nip->num < 10) x.rta_len=sizeof(struct rtattr)+4; 878 else x.rta_len=sizeof(struct rtattr)+5; 863 879 x.rta_type=index; 864 880 netlink_addanswer(buf,offset,&x,sizeof (struct rtattr)); 865 881 name[0]=nip->name[0]; 866 882 name[1]=nip->name[1]; 867 name[2]=(nip->num)%10+'0'; 868 name[3]=0; 869 netlink_addanswer(buf,offset,name,sizeof(name)); 883 if (nip->num < 10) { 884 name[2]=(nip->num)%10+'0'; 885 name[3]=0; 886 nl = 4; 887 } 888 else { 889 /* XXX: more than 100 interfaces??? --tvf */ 890 name[2]=(nip->num)/10+'0'; 891 name[3]=(nip->num)%10+'0'; 892 name[4] = 0; 893 nl = 5; 894 } 895 netlink_addanswer(buf,offset,name,nl); 896 if (nl % RTA_ALIGNTO > 0) 897 netlink_addanswer(buf,offset,&fill,RTA_ALIGNTO - (nl%RTA_ALIGNTO)); 870 898 } 871 899 872 900 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);