Hey Guys,

Is the rev_chap_name_len field in the ibft_tgt structure set to zero? if so
we should not be scanning for the reverse CHAP name in fwparam_ibft as a
zero in rev_chap_name_len effectively indicates that there is no reverse
CHAP username. If the field is a non zero value then this is likely a
firmware bug. Could you please post an entire iBFT dump from the failure
case?

Thanks,
Supreeth

On Tue, Feb 3, 2009 at 10:31 AM, Konrad Rzeszutek <kon...@virtualiron.com>wrote:

> >
> > Sure, if you can tell me how to get the blob?
>
> gcc find_ibft.c -o find_ibft
> sudo ./find_ibft blob
>
>
> >
>
> #include <stdio.h>
> #include <errno.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <unistd.h>
> #include <fcntl.h>
> #include <ctype.h>
> #include <stdint.h>
>
> const char *filename = "/dev/mem";
> int main(int argc, char *argv[])
> {
>
>        int fd = 0;
>        unsigned char *fbuf;
>        unsigned char *p;
>        struct stat buf;
>        int i,len;
>        unsigned int len_p;
>
>        fd = open(filename, O_RDONLY);
>        if (fd <= 0) {
>                printf("Could not open; err: %d(%s)\n", errno,
> strerror(errno));
>                return errno;
>        }
>        if (stat(filename, &buf) != 0) {
>                printf("Could not open; err: %d(%s)\n", errno,
> strerror(errno));
>                return errno;
>        }
>
>        len = 0x100000; // Up to 1MB.
>        fbuf = mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0);
>        if (fbuf == MAP_FAILED) {
>                printf("Could not map: error: %d(%s)\n", errno,
>                       strerror(errno));
>                return errno;
>        }
>        len_p = 0;
>        for (p = fbuf; p < fbuf + 0x100000; p += 4)
>        {
>                if (memcmp(p, "iBFT", 4) == 0) {
>                        len_p = *(unsigned int *)(p + 4);
>                        printf("iBFT detected. (%d)\n", len_p);
>                        break;
>                }
>        }
>        if (len_p)
>        {
>                if (argc > 1) {
>                        int outfd;
>                        outfd = open(argv[1], O_RDWR|O_CREAT, 0644);
>                        if (outfd != -1) {
>                                write(outfd, p, len_p);
>                                close(outfd);
>                        }
>                }
>                printf("(%lx): DATA:\n", p);
>
>                for (i = 0; i < len_p; i++) {
>                        if ((i % 70) == 0)
>                                printf("\n%.3x: ", i);
>                        if (isgraph(p[i]))
>                                printf("%c", p[i]);
>                        else
>                                printf("_");
>        //      putchar(fbuf[i]);
>                }
>                printf("\n");
>        }
>        else
>        {
>                printf("Bummer. No iBFT found.\n");
>        }
>        if (munmap(fbuf, len)) {
>                printf("Could not unmap: %d(%s)\n", errno, strerror(errno));
>                return errno;
>        }
>        close(fd);
>        return 0;
> }
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to