UpgradeNotes: patch-all2.patch

File patch-all2.patch, 5.8 KB (added by Ted Faber, 12 years ago)

more complete all parts patch

  • lwipv6/lwip-v6/src/core/netif.c

     
    518518        if (name == NULL) {
    519519                return NULL;
    520520        }
    521        
     521
     522        /* atoi allows longer names -- tvf */
    522523        if (name[2] >= '0'  && name [2] <= '9')
    523                 num = name[2] - '0';
     524                num = atoi(name+2);
    524525        else
    525526                num = 0;
    526527       
     
    683684                        else {
    684685                                ifr->ifr_name[0]=nip->name[0];
    685686                                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                                }
    689698                                ifr->ifr_name[5]= 0;
    690699                                retval=ERR_OK;
    691700                        }
    692701                } else {
    693702#define ifrname ifr->ifr_name
    694703                        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);
    696706                                retval=EINVAL;
    697707                        }
    698708                        else {
     
    858868
    859869static void netif_out_link_ifname (int index,struct netif *nip,void * buf,int *offset) {
    860870        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;
    863880        x.rta_type=index;
    864881        netlink_addanswer(buf,offset,&x,sizeof (struct rtattr));
    865882        name[0]=nip->name[0];
    866883        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));
    870899}
    871900
    872901static void netif_out_link_mtu (int index,struct netif *nip,void * buf,int *offset) {
  • xmview-os/xmview/capture_nested.c

     
    11921192        int (*fn) (void *arg);
    11931193        void *arg;
    11941194        void *parentpcb;
     1195        struct npcb *npcb;
    11951196};
    11961197
    11971198/* create a new (reduced) pcb for a thread */
    1198 static struct npcb *new_npcb(struct pcb *old)
     1199static struct npcb *new_npcb(struct pcb *old, struct npcb *npcb)
    11991200{
     1201        /*
    12001202        struct npcb *npcb;
    12011203        npcb=calloc(1,sizeof(struct npcb));
     1204        npcb = tryit + alloced++ * sizeof(struct npcb);
     1205        */
    12021206        npcb->flags=PCB_ALLOCATED;
    12031207        /* inherit the treepoch path from the generating thread */
    12041208        npcb->tst=old->tst;
     
    12271231static int clonewrap(void *carg){
    12281232        int (*fn) (void *arg) = ((struct clonearg *)(carg))->fn;
    12291233        void *arg=((struct clonearg *)(carg))->arg;
     1234        struct npcb *npcb = ((struct clonearg *)(carg))->npcb; 
    12301235        /* create a new pcb for the new thread, and link the pcb with this new
    12311236         * thread */
    1232         set_pcb(new_npcb(((struct clonearg *)(carg))->parentpcb));     
     1237        set_pcb(new_npcb(((struct clonearg *)(carg))->parentpcb, npcb));       
    12331238        /* free the data structure used to keep the thread info */
    12341239        free(carg);
    12351240        /* start the real thread */
     
    12481253        carg->fn=fn;
    12491254        carg->arg=arg;
    12501255        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));
    12511258        /* start a wrapper to the real main function of the thread */
    12521259        rv= libc__clone(clonewrap,child_stack,flags,carg,arg2,arg3,arg4);
    12531260        return rv;
  • xmview-os/xmview/um_exec.c

     
    180180}
    181181*/
    182182
     183#define NOUMBINWRAP
    183184#define UMBINWRAP LIBEXECDIR "/umbinwrap"
    184185/* wrap_in: execve handling */
    185186int wrap_in_execve(int sc_number,struct pcb *pc,
  • xmview-os/umnetlwipv6/umnetlwipv6.c

     
    154154        }
    155155}
    156156
     157static 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
    157166static void myputenv(struct ifname **head, int *intnum, char *paramval[], char *arg)
    158167{
    159168        int i;
    160169        for (i=0;i<INTTYPES;i++) {
    161170                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;
    165177                        }
    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;
    168180                        }
    169181                        break;
    170182                }
     
    244256
    245257int umnetlwipv6_init (char *source, char *mountpoint, unsigned long flags, char *args, struct umnet *nethandle) {
    246258        struct stack *s=lwip_stack_new();
     259        lwip_stack_flags_set(s,
     260                lwip_stack_flags_get(s) | LWIP_STACK_FLAG_FORWARDING);
    247261        if (s) {
    248262                lwipargtoenv(s,args);
    249263                umnet_setprivatedata(nethandle,s);